package com.example;

/**
 * Created by dllo on 16/1/20.
 */
public class MallardDuck extends Duck implements FlyBehavior,QuackBehavior{

    public MallardDuck() {
        setQuackBehavior(this);
        setFlyBehavior(this);
    }

    @Override
    public void display() {
        System.out.print("绿头鸭");
    }

    @Override
    public void swim() {
        System.out.print("绿头鸭会游泳");
    }

    @Override
    public void fly() {
        System.out.print("绿头鸭会飞");
    }

    @Override
    public void quack() {
        System.out.print("绿头鸭呱呱叫");
    }
}
